<template>
    <van-nav-bar title="联系客服" left-text="" left-arrow @click-left="goBack" />
    <div class="box">
        <div class="box-api">
            <img src="/assets/images/head1.jpg" alt="">
            <span>您好！我是客服菲菲，非常欢迎您的到来，有什么想和我聊聊的吗？</span>
        </div>
    </div>
    <div class="box-cont" v-html="content"></div>
    <div class="cont">
        <input type="text" placeholder="在这里输入文字" class="inp" id="msg" v-model="msg">
        <a href="javascript:" class="send" @click="sendmsg()">发送</a>
    </div>
</template>
<script setup>
const goBack = () => {
    history.back()
};
//客服聊天
const msg = ref('')
const content = ref('')
const sendmsg = async () => {
    content.value += `  <div class="box-user">
                        <span>${msg.value}</span>
                        <img src="/assets/images/1111.jpg" alt="">
                        </div>
                    `
    let result = await Api.productMind({ msg: msg.value })
    content.value += `  <div class="box-api">
                        <img src="/assets/images/head1.jpg" alt="">
                        <span>${result.content}</span>
                        </div>
                    `
    msg.value = ''
};
</script>
<style>
@import url('/assets/css/mind.css');
</style>